package GlavFinans::Module::Core::Controller::Captcha;
use utf8;
use Data::Dumper;
use Mojo::Base 'Mojolicious::Controller';

sub index {
	my $self = shift;

	my @letter = (0..9, 'a'..'z');
	my $code = join '', @letter[ map { int rand @letter } 1..5 ]; 

	$self->session('captcha.code' => $code);
	$self->render( data => $self->captcha($code), type => 'image/png');
}

1;
